<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="../back-common.jsp"%>
<%@ include file="/WEB-INF/pages/common/taglib.jsp"%>


<script src="${contextPath}/resources/common/js/jquery.validate.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" media="screen" href="${contextPath}/resources/common/css/errorform.css" />
    <table class="${tableclass}" style="width: 100%">
	    <thead>
	    	<tr><th> <strong class="am-text-primary am-text-lg">系统管理</strong> /  编辑参数</th></tr>
	    </thead>
    </table>

        <form:form  action="${contextPath}/admin/system/systemParameter/save" method="post" id="form1">
            <input id="name" name="name" value="${bean.name}" type="hidden">
            <div align="center">
            <table  align="center" class="${tableclass}" id="col1">
                <thead>
                    <tr class="sortable">
                        <th colspan="2">
                            <div align="center">
                                ${bean.name} 参数
                            </div>
                        </th>
                    </tr>
                </thead>
        <tr>
        <td>
          <div align="center" >功能说明</div>
       </td>
        <td>${bean.memo}</td>
      </tr>
      <tr>
        <td><div align="center">参数值</div></td>
        <td>
         <c:choose>
           	<c:when test="${bean.type == 'Selection' || bean.type == 'Boolean'}">
		       <select id="value" name="value">
				  <ls:optionGroup type="select" required="true" cache="true"
	                beanName="${bean.optional}" selectedValue="${bean.value}"/>
	            </select>
           	</c:when>
           	<c:when test="${bean.type == 'Password'}">
           		 <input type="password" name="value" id="value"  size="50" maxlength="200" class="${inputclass}" autocomplete="off"/>
           	 </c:when>
           	<c:when test="${bean.type == 'JSON'}">
           		 <textarea id="value" name="value" cols="80" rows="3">${bean.value}</textarea>
           	 </c:when>
           	<c:otherwise>
           		<input type="text" name="value" id="value" value="${bean.value}" size="50" maxlength="200" class="${inputclass}"/>
           	</c:otherwise>
           </c:choose>
        </td>
      </tr>
                <tr>
                    <td colspan="2">
                        <div align="center">
	                            <input type="submit" value="提交" class="${btnclass}" />
                            <input type="reset" value="重置" class="${btnclass}" />
                            <input type="button" value="返回" class="${btnclass}"
                                onclick="window.location='javascript:history.go(-1)'" />
                        </div>
                    </td>
                </tr>
            </table>
           </div>
        </form:form>
<script type="text/javascript">

	$(function() {
		 //斑马条纹
     	 $("#col1 tr:nth-child(even)").addClass("even");
     	 
		  $("#form1").validate({
		    rules: {
		      value: {
		      	required : true
		      }
		    },
		    messages: {
		      value: {
		      	required : "参数值不能为空!"
		      },
		    }
		});
	});
</script>

